<template>
  <div class="shiming">
    <div style="margin: 100px auto; width: 1020px; border: 1px #EAEAEA solid; padding: 80px; box-sizing: border-box; display: flex; justify-content: center; align-items: center;">
      <div style="text-align: center;">

        <!-- <div ><i class="el-icon-success" style="color: #14B508; font-size: 100px;"></i></div> -->
        <div><i class="el-icon-warning" style="color: #FF5E5E; font-size: 100px;"></i></div>


        <div style="color: #F92659; font-size: 36px; margin: 50px 0;" v-if="status == -1">已成功提交审核</div>
        <div style="color: #F92659; font-size: 36px; margin: 50px 0;" v-if="status == -2">
          <div>您提交的审核被拒绝了</div>
          <div>拒绝理由：{{reason}}</div>
        </div>
        <div style="display: flex; margin-bottom: 20px; color: #666; align-items: center;" v-if="status == -2">
          <div class="f1">重新上传营业执照：</div>
          <div class="f2">
            <el-upload class="avatar-uploader" action="#" :on-change="uploadok" :auto-upload="false" :show-file-list="false">
              <el-button v-if="!all.credentials" size="small" type="primary">点击上传</el-button>
              <img :src="all.credentials" v-if="all.credentials" style="width: 100px;">
            </el-upload>

            <el-button v-if="all.credentials" size="small" type="primary" @click="tijiao">提交营业执照</el-button>
          </div>
        </div>


        <div style="font-size: 14px; color: #7D7D7D; margin-bottom: 30px;">通常24小时内完成审核，我们将会以短信的方式通知您</div>
        <div style="font-size: 14px; color: #F92659; margin-bottom: 30px;">扫码添加{{moban.platform_name}}客服</div>
        <div><img src="../../static/kefu.png" style="width: 200px;  margin-bottom: 30px;"></div>
        <div style="color: #545454; font-size: 14px;">{{moban.platform_name}}系统的使用帮助、意见建议等均可联系客服</div>
      </div>

    </div>
  </div>
</template>

<script>
  import axios from "axios";
  export default {
    name: "foot",
    data() {
      return {
        status:this.$route.query.status,
        reason:this.$route.query.reason,
        all:{
          credentials:""
        }
      };
    },
    created() {

    },
    methods: {
      tijiao:function(){
        axios.post('/api/plan-market/shop/identify/update',this.all)
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$router.push('/login')
          } else {
          	this.$message.error(response.data.msg.info);
          }
        })
      },
      uploadok: function(file) {

      	if(file.raw.type != 'image/jpeg' && file.raw.type != 'image/png' && file.raw.type != 'image/jpg'){
      		this.$message.error('只能上传图片');
      		return false
      	}
      	var that = this;
      	var formData = new FormData();
      	formData.append("pic", file.raw);
      	axios.post('/api/plan-market/order-page/upload-pic', formData)
      		.then(response => {
      			if (response.data.msg.code == 0) {

      				that.all.credentials = response.data.data

      			} else {
      				that.$message.error(response.data.msg.info);
      			}
      		})
      },

    }
  };
</script>

<style scoped="less" lang="scss">
  .shiming{
    width: 1020px; margin: 0 auto;



  }
</style>
